package com.hnit.rol.show.controller;

import com.github.pagehelper.PageInfo;
import com.hnit.rol.commonutils.PageParam;
import com.hnit.rol.commonutils.Result;
import com.hnit.rol.model.entity.bookInfo.BookInfo;
import com.hnit.rol.model.entity.bookShow.BookShow;
import com.hnit.rol.model.vo.bookShow.BookShowVo;
import com.hnit.rol.model.vo.order.OrderInfoVo;
import com.hnit.rol.show.service.BookShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: recycling-of-love-system
 * @Date: 2023-04-08 10:23
 * @author: Fox0g
 * @description: TODO
 */
@RestController
@RequestMapping("api/show")
public class BookShowController {

    @Autowired
    private BookShowService bookShowService;

    @GetMapping("/getAllBookShow")
    public Result getAllBookShow(PageParam pageParam){
        PageInfo<BookShowVo> list = bookShowService.getBookShowList(pageParam);
        return Result.success(list);
    }

    @GetMapping("/getBookShowByBookName/{bookName}")
    public Result getBookShowByBookName(@PathVariable("bookName")String bookName, PageParam pageParam){
        PageInfo<BookShowVo> list = bookShowService.getBookShowListByCondition(bookName,pageParam);
        return Result.success(list);
    }

    @GetMapping("/getBookShowByBookType/{bookType}")
    public Result getBookShowByBookType(@PathVariable("bookType")String bookType, PageParam pageParam){
        PageInfo<BookShowVo> list = bookShowService.getBookShowListByBookType(bookType,pageParam);
        return Result.success(list);
    }
}
